import {commGet, commPost} from "@utils/service/index.js";

/**
 * 获取订单列表
 * @param data {Object}  请求参数
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getOrderPage(data) {
    return commGet({
        url: `/order/page`,
        method: 'get',
        data
    })
}

/**
 * 获取订单详情
 * @param data {Object}  请求参数
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getOrderDetail(data) {
    return commGet({
        url: `/order/basic`,
        method: 'get',
        data
    })
}

/**
 * 获取订单tab详情
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getTabDetail(data) {
    return commGet({
        url: `/order/detail`,
        method: 'get',
        data
    })
}

/**
 * 获取售后tab订单
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getTabTicket(data) {
    return commGet({
        url: `/order/ticket`,
        method: 'get',
        data
    })
}

/**
 * 获取物流tab订单
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getTabLogistics(data) {
    return commGet({
        url: `/order/logistics`,
        method: 'get',
        data
    })
}

/**
 * 获取物流tab订单详情
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getTabLogisticsDetail(data) {
    return commGet({
        url: `/order/logistics/detail`,
        method: 'get',
        data
    })
}

/**
 * 获取订单拦截信息
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getOrderInterceptInfo(data) {
    return commGet({
        url: `/order/getOrderInterceptInfo`,
        method: 'get',
        data
    })
}
/**
 * 订单拦截
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function orderIntercept(data) {
    return commGet({
        url: `/order/orderIntercept`,
        method: 'post',
        data
    })
}

/**
 * 获取订单跟踪日志信息
 * @param data
 * @returns {Promise<unknown extends (null | undefined) ? unknown : (unknown extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : unknown)>}
 */
export function getOrderTrackingLogInfo(data) {
    return commGet({
        url: `/order/getOrderTrackingLogInfo`,
        method: 'get',
        data
    })
}

/**
 * 获取平台SKU特殊服务列表
 * @param data
 * @returns {Promise<unknown extends (null | undefined) ? unknown : (unknown extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : unknown) extends (null | undefined) ? (unknown extends (null | undefined) ? unknown : (unknown extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : unknown)) : (unknown extends (null | undefined) ? unknown : (unknown extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : unknown) extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : (unknown extends (null | undefined) ? unknown : (unknown extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : unknown)))>}
 */
export function getListProductSku(data) {
    return commGet({
        url: `/wms/special/service/list/productSku`,
        method: 'get',
        data
    })
}
export function createTicket(data) {
    return commPost({
        url: `/wms/special/service/create/ticket`,
        method: 'post',
        data
    })
}

export function getReasonTree(data) {
    return commGet({
        url: `/csc/reason/tree`,
        method: 'get',
        data
    })
}

export function getShipping(data) {
    return commGet({
        url: `/order/get/shipping`,
        method: 'get',
        data
    })
}

export function getOrderItem(data) {
    return commGet({
        url: `/wms/resend/create/list/warehouseSkuInWms`,
        method: 'get',
        data
    })
}
export function getWarehouseOfSelectResend(data) {
    return commGet({
        url: `/wms/resend/create/list/warehouseOfSelectResend`,
        method: 'get',
        data
    })
}

export function getWarehouseSkuOfSelectResend(data) {
    return commGet({
        url: `/wms/resend/create/list/warehouseSkuOfSelectResend`,
        method: 'get',
        data
    })
}

export function getListProductSkuInWms(data) {
    return commGet({
        url: `/wms/resend/create/list/productSkuInWms`,
        method: 'get',
        data
    })
}

export function getProductSkuOfSelectResend(data) {
    return commGet({
        url: `/wms/resend/create/list/productSkuOfSelectResend`,
        method: 'get',
        data
    })
}
export function getProductSkuVersion(data) {
    return commGet({
        url: `/wms/resend/create/list/productSkuVersion`,
        method: 'get',
        data
    })
}

export function createResend(data) {
    return commPost({
        url: `/wms/resend/create/create`,
        method: 'post',
        data
    })
}
export function getResendWarehouseSkuInfo(data) {
    return commGet({
        url: `/wms/resend/create/get/resendWarehouseSkuInfo`,
        method: 'get',
        data
    })
}
export function getEditReason(data) {
    return commPost({
        url: `/wms/resend/create/edit/reason`,
        method: 'post',
        data
    })
}
export function getOperationLog(data) {
    return commGet({
        url: `/wms/resend/create/list/operationLog`,
        method: 'get',
        data
    })
}

